package vma.nicici.tests;

import vma.nicici.chat.gson.Message;

import com.google.gson.Gson;

import junit.framework.TestCase;

public class GsonTest extends TestCase {
	
	public void testMessage(){
		Gson gson = new Gson();
		Message msg = new Message(666L,"nedela","Ahoj, ako sa mas?",45.65654688,47.546654624);
		System.out.println(msg);
		String json = "{\"facebookUserID\":666,\"lat\":45.65654688,\"lon\":47.546654624,\"messageText\":\"Ahoj, ako sa mas?\",\"timestamp\":\"nedela\"}";
		assertEquals(json, gson.toJson(msg));
		Message emptyMsg = new Message();
		String emptyJson = "{\"facebookUserID\":-1,\"lat\":-1.0,\"lon\":-1.0,\"messageText\":\"\",\"timestamp\":\"\"}";
		assertEquals(emptyJson, gson.toJson(emptyMsg));		
	}

}
